﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="AdvertisingAdd.aspx.cs" Inherits="Framework.WebmasterTool.Advertisings.AdvertisingAdd"
    ValidateRequest="false" %>

<%@ Register Src="../../Controls/simpleImageUploadUserControl/SimpleImageUpload.ascx"
    TagName="SimpleImageUpload" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#spanClearDateFrom").click(function () {
                $("#<%= txtRealeaseDate.ClientID %>").val("");
            });
            $("#spanClearDateTo").click(function () {
                $("#<%= txtExpireDate.ClientID %>").val("");
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="Server">
    Thêm mới và cập nhật quảng cáo
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="Server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <table border="1" bordercolor="#cccccc" cellpadding="5" cellspacing="0" style="width: 100%;"
            rules="all">
            <tr style="border-bottom: solid 1px #ccc; background: #f5f5f5">
                <td colspan="3" align="left">
                    <span style="font-weight: bold; display: block; height: 20px; line-height: 20px;
                        float: left; margin-right: 20px;">Thông tin khách hàng</span>
                    <asp:Button ID="btnCancel" runat="server" Text="Quay lại" Style="float: right" OnClick="btnCancel_Click" />
                    <asp:Button ID="btnSave" runat="server" Text="Lưu" Style="float: right; margin-right: 2px"
                        ValidationGroup="advertising" OnClick="btnSave_Click" />
                </td>
            </tr>
            <tr style="border-bottom: solid 1px #cccccc">
                <td align="left" colspan="3" style="text-align: center;">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" Font-Bold="True" ForeColor="Red"
                        ValidationGroup="advertising" DisplayMode="List" />
                    <asp:Label ID="lblMessage" runat="server" Font-Bold="true" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Tên khách hàng:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtCustomerName" runat="server" Width="250"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCustomerName"
                        ValidationGroup="advertising" ErrorMessage="Chưa nhập tên khách hàng." Display="Dynamic">*</asp:RequiredFieldValidator>
                </td>
                <td rowspan="23" style="text-align: right; vertical-align: top; width: 223px">
                    <div id="divFlash" runat="server" visible="false" style='padding: 10px; background: #fff;
                        border: solid 1px #ccc'>
                        <embed src="" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer"
                            type="application/x-shockwave-flash" width="223" height="150"></embed></div>
                    <asp:Literal ID="ltrMedia" runat="server"></asp:Literal>
                    <img id="imgGif" runat="server" style="width: 100%" alt="" />
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Địa chỉ:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtAddress" runat="server" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Điện thoại:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtPhone" runat="server" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Fax:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtFax" runat="server" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Email:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtEmail" runat="server" Width="250px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail"
                        ErrorMessage="Sai đinh dạng email." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        Display="Dynamic" ValidationGroup="advertising">*</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr style="border-bottom: solid 1px #ccc; background: #f5f5f5">
                <td colspan="2" align="left">
                    <span style="font-weight: bold; display: block; height: 20px; line-height: 20px;
                        float: left; margin-right: 20px;">Thông tin mẫu quảng cáo</span>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Tên quảng cáo:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtAdvTitle" runat="server" Width="250"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtAdvTitle"
                        ValidationGroup="advertising" ErrorMessage="Chưa nhập tên quảng cáo." Display="Dynamic">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr runat="server" visible="false">
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Tên quảng cáo(en):
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtAdvTitle_en" runat="server" Width="250"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Loại quảng cáo:
                </td>
                <td style="text-align: left; text-align: center;">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:RadioButton ID="rdbIsImage" runat="server" Text="Hình ảnh" GroupName="upload"
                                Checked="true" AutoPostBack="true" OnCheckedChanged="rdbIsImage_CheckedChanged" />
                            <asp:RadioButton ID="rdbIsFlash" runat="server" Text="Flash" GroupName="upload" AutoPostBack="true"
                                OnCheckedChanged="rdbIsFlash_CheckedChanged" />
                            <asp:RadioButton ID="rdbIsMedia" runat="server" Text="Media" GroupName="upload" AutoPostBack="true"
                                OnCheckedChanged="rdbIsMedia_CheckedChanged" />
                            <asp:RadioButton ID="rdbIsGif" runat="server" Text="Ảnh động" GroupName="upload"
                                AutoPostBack="true" OnCheckedChanged="rdbIsGif_CheckedChanged" />
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="rdbIsImage" EventName="CheckedChanged" />
                            <asp:AsyncPostBackTrigger ControlID="rdbIsFlash" EventName="CheckedChanged" />
                            <asp:AsyncPostBackTrigger ControlID="rdbIsMedia" EventName="CheckedChanged" />
                            <asp:AsyncPostBackTrigger ControlID="rdbIsGif" EventName="CheckedChanged" />
                            <asp:PostBackTrigger ControlID="btnSave" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Upload quảng cáo:
                </td>
                <td style="text-align: left">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                        <ContentTemplate>
                            <uc1:SimpleImageUpload ID="siuUploadAdvertising" runat="server" CssClass="ImageUpload"
                                AutoOpenImageEditPopupAfterUpload="true" />
                            <asp:FileUpload ID="FileUpload1" runat="server" Visible="false" />
                            <asp:FileUpload ID="FileUpload2" runat="server" Visible="false" />
                            <asp:TextBox ID="txtMedia" runat="server" Width="350px" Height="200px" TextMode="MultiLine"
                                Visible="false">
                            </asp:TextBox>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="rdbIsImage" EventName="CheckedChanged" />
                            <asp:AsyncPostBackTrigger ControlID="rdbIsFlash" EventName="CheckedChanged" />
                            <asp:AsyncPostBackTrigger ControlID="rdbIsMedia" EventName="CheckedChanged" />
                            <asp:AsyncPostBackTrigger ControlID="rdbIsGif" EventName="CheckedChanged" />
                            <asp:PostBackTrigger ControlID="btnSave" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Chiều dài(Width):
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtWidth" runat="server" Width="250"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Chưa nhập chiều rộng cho quảng cáo"
                        ControlToValidate="txtWidth" Display="Dynamic" ValidationGroup="advertising">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="txtWidth"
                        Type="Integer" MinimumValue="1" MaximumValue="1000" ErrorMessage="Chiều rộng quảng cáo từ 1 đến 1000"
                        ValidationGroup="advertising" Display="Dynamic">*</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Chiều cao(Height):
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtHeight" runat="server" Width="250"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Chưa nhập chiều cao cho quảng cáo"
                        ControlToValidate="txtHeight" Display="Dynamic" ValidationGroup="advertising">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtHeight"
                        Type="Integer" MinimumValue="1" MaximumValue="1000" ErrorMessage="Chiều cao quảng cáo từ 1 đến 1000"
                        ValidationGroup="advertising" Display="Dynamic">*</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Link quảng cáo:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtLink" runat="server" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Ngày đăng:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtRealeaseDate" runat="server" Width="200"></asp:TextBox>
                    <AjaxControlToolkit:CalendarExtender ID="CalendarExtender1" Format="dd/MM/yyyy hh:mm:ss tt"
                        runat="server" TargetControlID="txtRealeaseDate">
                    </AjaxControlToolkit:CalendarExtender>
                    <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="DateTime"
                        ClearMaskOnLostFocus="true" TargetControlID="txtRealeaseDate" AcceptAMPM="true"
                        Mask="99/99/9999 99:99:99" AutoComplete="false" InputDirection="LeftToRight"
                        ErrorTooltipEnabled="true" MessageValidatorTip="true">
                    </AjaxControlToolkit:MaskedEditExtender>
                    <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
                        ValidationGroup="ArticleAdd" ControlToValidate="txtRealeaseDate" ControlExtender="MaskedEditExtender1"
                        EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                        IsValidEmpty="true"> 
                    </AjaxControlToolkit:MaskedEditValidator>
                    <span id="spanClearDateFrom" style="cursor: pointer;">[x]</span>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Ngày hết hạn:
                </td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtExpireDate" runat="server" Width="200"></asp:TextBox>
                    <AjaxControlToolkit:CalendarExtender ID="CalendarExtender2" Format="dd/MM/yyyy hh:mm:ss tt"
                        runat="server" TargetControlID="txtExpireDate">
                    </AjaxControlToolkit:CalendarExtender>
                    <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" MaskType="DateTime"
                        ClearMaskOnLostFocus="true" TargetControlID="txtExpireDate" AcceptAMPM="true"
                        Mask="99/99/9999 99:99:99" AutoComplete="false" InputDirection="LeftToRight"
                        ErrorTooltipEnabled="true" MessageValidatorTip="true">
                    </AjaxControlToolkit:MaskedEditExtender>
                    <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
                        ValidationGroup="ArticleAdd" ControlToValidate="txtExpireDate" ControlExtender="MaskedEditExtender2"
                        EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                        IsValidEmpty="true"> 
                    </AjaxControlToolkit:MaskedEditValidator>
                    <span id="spanClearDateTo" style="cursor: pointer;">[x]</span>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Vị trí:
                </td>
                <td>
                    <asp:DropDownList ID="ddlPosition" runat="server" Width="150">
                        <asp:ListItem Value="" Text="Tự do"></asp:ListItem>
                        <asp:ListItem Value="top" Text="Phía trên"></asp:ListItem>
                        <asp:ListItem Value="middle" Text="Ở giữa"></asp:ListItem>
                        <asp:ListItem Value="bottom" Text="Phía dưới"></asp:ListItem>
                        <asp:ListItem Value="left" Text="Bên trái"></asp:ListItem>
                        <asp:ListItem Value="right" Text="Bên phải"></asp:ListItem>
                        <asp:ListItem Value="float_left" Text="Trượt trái"></asp:ListItem>
                        <asp:ListItem Value="float_right" Text="Trượt phải"></asp:ListItem>
                        <asp:ListItem Value="popup" Text="Popup"></asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Sắp xếp:
                </td>
                <td style="text-align: left">
                    <asp:TextBox runat="server" ID="txtDisplayOrder" Width="250" Text="0"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Chưa nhập vị trí cho quảng cáo"
                        ControlToValidate="txtDisplayOrder" Display="Dynamic" ValidationGroup="advertising">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="txtDisplayOrder"
                        Type="Integer" MinimumValue="0" MaximumValue="9999" ErrorMessage="Vị trí quảng cáo phải từ 0 đến 9999"
                        ValidationGroup="advertising" Display="Dynamic">*</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Kích hoạt:
                </td>
                <td style="text-align: left">
                    <asp:CheckBox ID="chkIsActive" runat="server" Text="Hiển thị" Checked="true" />
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Người tạo:
                </td>
                <td style="text-align: left">
                    <asp:Label ID="lblAddedBy" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Ngày tạo:
                </td>
                <td style="text-align: left">
                    <asp:Label ID="lblAddedDate" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Người sửa:
                </td>
                <td style="text-align: left">
                    <asp:Label ID="lblUpdatedBy" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Ngày sửa:
                </td>
                <td style="text-align: left">
                    <asp:Label ID="lblUpdatedDate" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="background: #f5f5f5; width: 150px;" align="right">
                    Lượt click:
                </td>
                <td style="text-align: left">
                    <asp:Label ID="lblClickCount" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
